Read the domid and vifid from the store, rather than horribly slicing up the
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 12 Dec 2005 17:13:38 +0000 (17:13 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 12 Dec 2005 17:13:38 +0000 (17:13 +0000)
store path.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/examples/vif-nat

index 9ce79f04346ef02343995bf1996f41e1ffb7d714..b9e353f1038149563bee6c1e7685e60938f0db33 100644 (file)
@@ -42,8 +42,8 @@ then
 fi
 
 
-domid=$(echo "$XENBUS_PATH" | sed -n 's#.*/\([0-9]*\)/[0-9]*$#\1#p')
-vifid=$(echo "$XENBUS_PATH" | sed -n 's#.*/[0-9]*/\([0-9]*\)$#\1#p')
+domid=$(xenstore_read "$XENBUS_PATH/frontend-id")
+vifid=$(xenstore_read "$XENBUS_PATH/handle")
 vifid=$(( $vifid + 1 ))